import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class realstart extends JFrame implements ActionListener{
    private JLabel jLabel;
    private JCheckBox jCheckBox;
    private JCheckBox jCheckBox2;
    ButtonGroup buttonGroup;

    JFrame jf=this;
    public realstart(){
        setTitle("学生成绩管理系统");
        setLayout(new BorderLayout());
        jLabel=new JLabel("学生成绩管理系统:请选择身份",SwingConstants.CENTER);
        jLabel.setFont(new Font("华文行楷",Font.PLAIN,40));

        jCheckBox=new JCheckBox("学生");
        jCheckBox.setFont(new Font("楷体",Font.PLAIN,35));


        jCheckBox2=new JCheckBox("教师");
        jCheckBox2.setFont(new Font("楷体",Font.PLAIN,35));
        buttonGroup=new ButtonGroup();


        buttonGroup.add(jCheckBox);
        buttonGroup.add(jCheckBox2);
        add(jLabel,BorderLayout.NORTH);
        add(jCheckBox,BorderLayout.CENTER);
        add(jCheckBox2,BorderLayout.SOUTH);

        jCheckBox.addActionListener(this);
        jCheckBox2.addActionListener(this);

        setBounds(100,200,600,400);
        setResizable(false);
        setVisible(true);
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }
    public void actionPerformed(ActionEvent actionEvent) {

        if (actionEvent.getActionCommand().equals("教师")){
                new startpage();
                jf.dispose();
        }else if (actionEvent.getActionCommand()==("学生")){
            new studentpage();
            jf.dispose();
        }
    }
}
